import styled from "@emotion/styled";
import PageLayout from "../../components/core/PageLayout";
import { FlexContentBox } from "../../components/styled";
import useDashboardModel from "../../model/useDashboardModel";
import { useMountAsync } from "../../utils";
import InfoView from './infoView'
import WelcomeView from './welcomeView'

const Dashboard = () => {
    const dashboard = useDashboardModel()

    useMountAsync(() => {
        dashboard.startGetDashboardInfo()
        dashboard.startGetD60Info()
        dashboard.startGetD90Info() 
    })

    return <PageLayout title="首页" subTitle="工作台">
        <TopCard>
            <WelcomeView />
            <InfoView />
        </TopCard>
    </PageLayout>
}

const TopCard = styled(FlexContentBox)`
margin-top: 2px;
width: 100%;
background-color: #FFF;
padding: 40px 20px;
justify-content: space-between;
`

export default Dashboard
